package com.chinadaas.hangzhou.archetypeweb.domain.page;

import java.util.Collections;
import java.util.List;

/*******************************************************************************
 * - Copyright (c)  2018  chinadaas.com
 *
 *   @author chr
 * - File Name: com.chinadaas.bill.service.com.chinadaas.platform.bill.common.model.PageModel
 * - Description:
 *
 *
 * - Function List:
 *
 *
 * - History:
 * Date         Author          Modification
 * 2019/05/28   chr             Create file
 *******************************************************************************/
public class PageModel<T> {

    private List<T> results = Collections.emptyList();

    private long totalCount = 0;

    private long pageSize = 10;

    private long targetPage = 1;

    public long getTargetPage() {
        return targetPage;
    }

    public void setTargetPage(long targetPage) {
        this.targetPage = targetPage;
    }

    public long getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(long totalCount) {
        this.totalCount = totalCount;
    }

    public List<T> getResults() {
        return results;
    }

    public void setResults(List<T> results) {
        this.results = results;
    }

    public long getTotalPage() {
        return (totalCount + pageSize - 1) / pageSize;
    }

    public long getPageSize() {
        return pageSize;
    }

    public void setPageSize(long pageSize) {
        this.pageSize = pageSize;
    }
}
